<?php

class Recaptcha {
    private static $pub_key = "6LfXLPESAAAAAALvqkwoMF_CmlufqMK9rNFgDJp9";
    private static $priv_key = "6LfXLPESAAAAADGj-UKYEXZ2Vmc7G7yIW4o2YbL5";
    static function GetHtml(){
        return recaptcha_get_html(self::$pub_key);
    }
    
    static function Check($challenge, $response){
        $result = recaptcha_check_answer(self::$priv_key, $_SERVER['HTTP_HOST'], $challenge, $response);
        if(!$result->is_valid){
            Logger::error(t($result->error));
        }
        return $result->is_valid;
    }
}
